home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Power Programmierung
/
Power-Programmierung (Tewi)(1994).iso
/
magazine
/
drdobbs
/
1987
/
06
/
bbs.l3
< prev
next >
Wrap
Text File
|
1987-05-05
|
1KB
|
65 lines
Listing Three
upld
# verify that a file name has been entered (in argument 1 - $1)
1 if [ -n "$1" ]
2 then
# verify that a file with the same name isn't already stored in the Uploads directory
3 if [ -f /u/bbs/Uploads/$1 ]
4 then
# the file name already exists
5 echo "Please give your file another name. $1 already exists."
6 else
# collect the file transfer protocol
7 echo 'who am i | cut -f1 -d" " ' 'date | cut -c1-16' "upld" $1 >>/u/bbs/log.file
8 echo "Transfer protocol (X = Xmodem; A = ASCII): \c"
9 read method
10 if [ "$method" = X -o "$method" = x ]
11 then
# receive a binary file using the XModem protocol
12 xmodem -rb /u/bbs/Uploads/$1
13 else
# receive an ASCII file
14 echo
15 echo "Begin sending ASCII file."
16 echo "Type a CNTRL-d when finished transmitting."
17 echo
18 cat > /u/bbs/Uploads/temp
19 cp /u/bbs/Uploads/temp /u/bbs/Uploads/$1
20 fi
# collect the file description
21 echo "Please enter a one line description of your file."
22 read desc
23 echo $1 $desc >>/u/bbs/Uploads/Doc.file
24 fi
25 else
# no file name was entered
26 echo "Please enter the name of the file you wish to upload on"
27 echo "the command line."
28 fi